package com.ruoyi.edit.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.edit.utils.UuidUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.edit.mapper.AbilityMapper;
import com.ruoyi.edit.domain.Ability;
import com.ruoyi.edit.service.IAbilityService;
import com.ruoyi.common.core.text.Convert;

/**
 * 能力指标Service业务层处理
 * 
 * @author qiufeng
 * @date 2022-03-10
 */
@Service
public class AbilityServiceImpl implements IAbilityService 
{
    @Autowired
    private AbilityMapper abilityMapper;

    /**
     * 查询能力指标
     * 
     * @param id 能力指标主键
     * @return 能力指标
     */
    @Override
    public Ability selectAbilityById(String id)
    {
        return abilityMapper.selectAbilityById(id);
    }

    /**
     * 查询能力指标列表
     * 
     * @param ability 能力指标
     * @return 能力指标
     */
    @Override
    public List<Ability> selectAbilityList(Ability ability)
    {
        return abilityMapper.selectAbilityList(ability);
    }

    /**
     * 新增能力指标
     * 
     * @param ability 能力指标
     * @return 结果
     */
    @Override
    public int insertAbility(Ability ability)
    {
        ability.setId(UuidUtil.getUuid());
        ability.setDeleted(0);
        ability.setCreated(new Date());
        return abilityMapper.insertAbility(ability);
    }

    /**
     * 修改能力指标
     * 
     * @param ability 能力指标
     * @return 结果
     */
    @Override
    public int updateAbility(Ability ability)
    {
        return abilityMapper.updateAbility(ability);
    }

    /**
     * 批量删除能力指标
     * 
     * @param ids 需要删除的能力指标主键
     * @return 结果
     */
    @Override
    public int deleteAbilityByIds(String ids)
    {
        return abilityMapper.deleteAbilityByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除能力指标信息
     * 
     * @param id 能力指标主键
     * @return 结果
     */
    @Override
    public int deleteAbilityById(String id)
    {
        return abilityMapper.deleteAbilityById(id);
    }
}
